<template>
  <div class="home-page">
    <div class="card">
      <h1 class="title">Pokémon Battle!</h1>
      <p  class="subtitle">努力成为冠军吧</p>
      <div class="button-group">
        <button class="primary-button" @click="startMatching">开始匹配</button>
        <button class="secondary-button" @click="openBackpack">我的背包</button>
        <button class="secondary-button" @click="openMyBox">我的箱子</button>
        <button class="secondary-button" @click="getPokemon">获得Pokémon</button>
      </div>
    </div>
  </div>
</template>

<script setup>
import { inject } from 'vue';

const navigate = inject('navigate');

const startMatching = () => {
  navigate('matching');
};

const openBackpack = () => {
  navigate('backpack');
};

const openMyBox = () => {
  navigate('myBox');
};

const getPokemon = () => {
  navigate('getPokemon');
};
</script>

<style scoped>
.home-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  max-width: 400px;
  width: 100%;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 32px;
  text-align: center;
}

.title {
  font-size: 32px;
  font-weight: bold;
  color: #333;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.primary-button {
  background-color: #e74c3c;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
}

.primary-button:hover {
  background-color: #c0392b;
}

.secondary-button {
  background-color: #fff;
  color: #3498db;
  padding: 12px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
  border: 2px solid #3498db;
}

.secondary-button:hover {
  background-color: #f0f8ff;
}

.subtitle{
  color: #666;
  margin-bottom: 32px;
}
</style>